package concurrent;

public class StaticSingleton {

    private StaticSingleton() {
    }

    private static class StaticSingletonHandler {
        private static StaticSingleton instance = new StaticSingleton();
    }

    public static StaticSingleton getInstance() {
        return StaticSingletonHandler.instance;
    }


    public static void main(String[] args) {
        Thread[] t = new Thread[100];
        for (int i=0;i < t.length; i++) {
            t[i] = new Thread(() -> System.out.println(StaticSingleton.getInstance()));
        }

        for (int i=0;i < t.length; i++) {
            t[i].start();
        }

    }

}
